package com.leyou.common.vo;

import com.leyou.common.enums.ExceptionEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * 记录异常信息
 */
@Data
public class ExceptionResult {

    private int status; // 状态码
    private String message; // 异常信息
    private Date timeStamp; // 时间戳

    public ExceptionResult(ExceptionEnum exceptionEnum){
        this.status = exceptionEnum.getCode();
        this.message = exceptionEnum.getMessage();
        this.timeStamp = new Date();
    }

}
